function btnMouseOver(btn)
{
  if(btn.className == 'btn')
  {
    btn.style.textDecoration='underline';
    btn.style.background='#6d84b4';
    btn.style.cursor='pointer';
  }
}

function btnMouseOut(btn)
{
  if(btn.className == 'btn')
  {
    btn.style.textDecoration='none';
    btn.style.background='#5c75aa';
    btn.style.cursor='default';
  }
}

// Get the user level information
function retrieveUserInfo(uid)
{
  var userRequest = GXmlHttp.create();
  userRequest.open('GET', 'userInfo.php?' + 'uid=' + uid, true);
  userRequest.onreadystatechange = function() 
  {
    if (userRequest.readyState == 4) 
    {
      xmlDoc = userRequest.responseXML;
      if(userRequest.responseText != '<users>-1</users>')
      {
        if(xmlDoc != null)
        {
          user = xmlDoc.documentElement.getElementsByTagName("user");
          switch( user[0].getAttribute("level") )
          {
            case '1':
              var tempHTML = '<img src="images/trophy.png" onMouseOver="Tip(\'Congrats! You are in level 1..<br />Keep walking to reach level 2!!\');this.src=\'images/trophy2.png\';" onMouseOut="UnTip();this.src=\'images/trophy.png\'" />';
              document.getElementById('badge').innerHTML = tempHTML;
              break;
          }
          document.getElementById('visitsFavourites').innerHTML += '<br />' +
          ' You are at Level : ' + user[0].getAttribute("level") + '<br />' +
          ' Walks visited : ' + user[0].getAttribute("visited") + '<br />' +
          ' Walks favorited : ' + user[0].getAttribute("favorited");
        }
        else
          alert('Error Loading Data from File! Please try again..');
      }
      else
        alert('User info not found!');
    } 
  }
  userRequest.send(null);
}